#include <iostream>

int const maxn = 100007;
int da[maxn];
int n, m;

int main()
{
	std::cin >> n >> m;
	for (int i = 0, a, b; i < m; i++) {
		std::cin >> a >> b;
		for (int j = b; j <= n; j += a) da[j]++;
	}
	std::cout << da[1];
	for (int i = 2; i <= n; i++) std::cout << ' ' << da[i];
	std::cout << '\n';
}

